<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<c:if test="${empty visitor ||visitor.username eq 'guest'}">
	<c:redirect url="wel!welcome.z" />
</c:if>

<head>
	<title>修改物料信息</title>
	<style type="text/css">
	form div { width: 49%;float:left; }
	</style>
		<script type="text/javascript" src="js/jquery.validate.pack.js"></script>
	<script type="text/javascript">
	jq(function() {
		jq("button.valid").parents("form").validate({
			rules: {
			"input.code": {required: true,maxlength: 32},
			"input.name": {maxlength: 64},
			"input.specification": {maxlength: 2048},
			"input.footprint": {maxlength: 512},
			"input.brand": {maxlength: 64},
			"input.description": {maxlength: 2048},
			"input.supplier": {maxlength: 64},
			"input.pcbDecal": {maxlength: 512},
			"input.tmpCode": {maxlength: 32},
			"input.remark": {maxlength: 2048}
			}
		});
	});
	</script>
</head>

<body>

	<fieldset>
		<legend>
			修改物料:
		</legend>
	<form action="m!update.z" method="post" >
		<div id="main">
		<label>
			物料编号 ${input.code}
		<br />
		</label>
		
		<label>
			物料名称
		<br />
		<input type="text" name="input.name" tabindex="3" value="${input.name}"/>
		<br />
		</label>
		
		<label>
			临时编码
		<br />
		<input type="text" name="input.tmpCode" tabindex="4" value="${input.tmpCode}"/>
		<br />
		</label>
		
		<label>
			备注
		<br />
		<textarea name="input.remark" rows="3" cols="20" tabindex="5" >${input.remark}</textarea>
		<br />
		</label>
		
		<label>
			采购状态
		</label>
		<br />
		<input type='radio' name="input.state" value="未发布" <c:if test="${input.state eq '未发布'}">checked="checked"</c:if> />未发布
		<input type='radio' name="input.state" value="推荐" <c:if test="${input.state eq '推荐'}">checked="checked"</c:if>/>推荐
		<input type='radio' name="input.state" value="一般" <c:if test="${input.state eq '一般' ||empty display['material'].state }">checked="checked"</c:if>  />一般
		<input type='radio' name="input.state" value="不推荐" <c:if test="${input.state eq '不推荐'}">checked="checked"</c:if>/>不推荐
		<input type='radio' name="input.state" value="停用" <c:if test="${input.state eq '停用'}">checked="checked"</c:if>/>停用
		<br />
		
		<label>
			品牌
		<br />
		<input type="text" name="input.brand" tabindex="6" value="${input.brand}"/>
		<br />
		</label>
		
		<label>
			供货商
		<br />
		<input type="text" name="input.supplier" tabindex="7" value="${input.supplier}"/>
		<br />
		</label>

		<label>
			收件人地址（多个地址请用英文分号隔开）
		</label>
		<br />
		<input type="text" type="text" name="mail.tosSplit" tabindex="8" />
		<br />
		<c:forEach var="mail" items="${display['emails']}">
			<input type="checkbox" name="mail.tos" tabindex=""
				value="${mail.email}" />${mail.email}(${mail.realname })
		</c:forEach>
		<br />
		
		<label>
			邮件内容
		</label>
		<br />
		<textarea name="mail.contentText" tabindex="9"></textarea>
		<br />
		</div>
		
		<div class="secend">
		<label>
			规格型号
		<br />
		<textarea name="input.specification" rows="3" cols="20"
			tabindex="10" >${input.specification}</textarea>
		</label>
		<br />
		
		<label>
			器件封装
		<br />
		<input type="text" name="input.footprint" tabindex="11" value="${input.footprint}"/>
		<br />
		</label>
		
		<label>
			器件描述
		<br />
		<textarea name="input.description" rows="3" cols="20" tabindex="12" >${input.description}</textarea>
		<br />
		</label>
		
		<label>
			PCB封装
		<br />
		<input type="text" name="input.pcbDecal" tabindex="13" value="${input.pcbDecal}"/>
		<br />
		</label>
		
		</div>
		
		<div>
		<button type="submit" tabindex="14" class="valid">
			保存
		</button>
		<button type="button"  onClick="buttonAction(this,'m!display.z?id=${input.id}')" tabindex="15">
			返回
		</button>
		</div>
	</form>
	</fieldset>
</body>